//package com.itheima.mp.config.es;
//
//import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
//import org.springframework.data.elasticsearch.core.IndexOperations;
//import org.springframework.data.elasticsearch.core.cluster.ClusterOperations;
//import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter;
//import org.elasticsearch.client.RestHighLevelClient;
//
//import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;
//import org.springframework.data.elasticsearch.core.IndexOperations;
//import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter;
//import org.elasticsearch.client.RestHighLevelClient;
//
//public class CustomElasticsearchRestTemplate extends ElasticsearchRestTemplate {
//
//    // 构造方法
//    public CustomElasticsearchRestTemplate(RestHighLevelClient client) {
//        super(client);
//    }
//
//    public CustomElasticsearchRestTemplate(RestHighLevelClient client, ElasticsearchConverter converter) {
//        super(client, converter);
//    }
//
//    // 重写索引操作方法，禁用自动创建
//    @Override
//    public IndexOperations indexOps(Class<?> clazz) {
//        IndexOperations indexOps = super.indexOps(clazz);
//        // 关键：不自动创建索引（默认会自动创建，这里通过不调用create方法实现）
//        return indexOps;
//    }
//}
